#ifndef PROCESS_H
#define PROCESS_H

#include <QString>
class Proces{

    public:

        int priority;
        int quantum;
        int pid;
        int inter;
        int ya;
        Proces *next;
        QString name;
        QString state;

        /////////////////////////////////////////////////////
        // Constructor del proceso
        //----------------------------------------------------------------------------
        Proces(int p,int q,int n,int i){
            priority=p;
            quantum=q;
            pid=n;
            inter=i;
            next=NULL;
            name=QString("p"+QString("%1").arg(n));
            state=QString("Inactivo");
            ya=0;
        }

        /////////////////////////////////////////////////////
        // metodo encargado de comparar dos procesos
        //----------------------------------------------------------------------------
        int compareTo(Proces *o) {

            if(this->priority<=o->priority){
                if(this->priority==o->priority){
                    if(this->quantum<=o->quantum){
                        if(this->quantum==o->quantum){
                            if(this->pid<=o->pid){
                                if(this->pid==o->pid){
                                    return 0;
                                }else return -1;
                            }else return 1;
                        }else return -1;
                    }else return 1;
                }else return -1;
            }else return 1;
        }
};

#endif // PROCESS_H
